package com.bw.day03.room

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query

@Dao
interface CommentDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(comment: Comment)
    @Query("select * from comment where goodsid=:goodsId")
    fun queryAll(goodsId: Int): MutableList<Comment>
    @Query("select * from comment where goodsid=:goodsId and msg like '%'||:keyword||'%'")
    fun query(keyword: String,goodsId: Int): MutableList<Comment>
}